﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:input="clr-namespace:System.Windows.Controls">

  <Style TargetType="input:ListTimePickerPopup">
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="PopupMinutesInterval" Value="30" />
    <Setter Property="PopupSecondsInterval" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="input:ListTimePickerPopup">
          <Grid Background="Transparent">
            <vsm:VisualStateManager.VisualStateGroups>
              <!-- Common States -->
              <vsm:VisualStateGroup x:Name="CommonStates">
                <vsm:VisualStateGroup.Transitions>
                  <vsm:VisualTransition GeneratedDuration="0"/>
                </vsm:VisualStateGroup.Transitions>
                <vsm:VisualState x:Name="Normal"/>
                <vsm:VisualState x:Name="Disabled">
                </vsm:VisualState>
              </vsm:VisualStateGroup>
              <vsm:VisualStateGroup x:Name="FocusStates">
                <vsm:VisualState x:Name="Focused">
                </vsm:VisualState>
                <vsm:VisualState x:Name="Unfocused"/>
              </vsm:VisualStateGroup>

              <!-- Contained States -->
              <vsm:VisualStateGroup x:Name="ContainedByPickerStates">
                <vsm:VisualState x:Name="Contained">
                  <Storyboard />
                </vsm:VisualState>
                <vsm:VisualState x:Name="NotContained">
                  <Storyboard />
                </vsm:VisualState>
              </vsm:VisualStateGroup>

              <!-- PopupModeStates -->
              <vsm:VisualStateGroup x:Name="PopupModeStates">
                <vsm:VisualState x:Name="AllowSecondsAndDesignatorsSelection">
                </vsm:VisualState>
                <vsm:VisualState x:Name="AllowTimeDesignatorsSelection">
                </vsm:VisualState>
                <vsm:VisualState x:Name="AllowSecondsSelection">
                </vsm:VisualState>
                <vsm:VisualState x:Name="HoursAndMinutesOnly">
                </vsm:VisualState>
              </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>

            <ListBox 
              x:Name="ListBox"
              Style="{TemplateBinding ListBoxStyle}"
              ItemContainerStyle="{TemplateBinding ListBoxItemStyle}"
              IsTabStop="True"
              TabIndex="1"
              MaxHeight="130"
              DisplayMemberPath="Key"
              DataContext="{TemplateBinding TimeItemsSelection}"
              ItemsSource="{Binding Items}"
              SelectedItem="{Binding SelectedItem, Mode=TwoWay}" >
            </ListBox>

          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>